home *** CD-ROM | disk | FTP | other *** search
/ Borland JBuilder 6 / jbuilder6.iso / Documents / JAVA Programming / examples / 12 / PropDemo.java < prev    next >
Encoding:
Java Source  |  2000-09-08  |  616 b   |  16 lines

  1. import java.util.Properties;
  2. class PropDemo {
  3. static Properties prop = new Properties();
  4. public static void main(String args[]) {
  5. prop.put("Title", "put title here");
  6. prop.put("Author", "put name here");
  7. prop.put("isbn", "isbn not set");
  8. Properties book = new Properties(prop);
  9. book.put("Title", "The Java Handbook");
  10. book.put("Author", "Patrick Naughton");
  11. System.out.println("Title: " + book.getProperty("Title"));
  12. System.out.println("Author: " + book.getProperty("Author"));
  13. System.out.println("isbn: " + book.getProperty("isbn"));
  14. System.out.println("ean: " + book.getProperty("ean", "???"));
  15. } }
  16.